package com.hit.aircraftwar.bullet;

import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;

import com.hit.aircraftwar.application.ImageManager;

public class Missile extends AbstractBullet {

    private int round = 1;

    public Missile(int locationX, int locationY, int speedX, int speedY, int power) {
        super(locationX, locationY, speedX, speedY, 0);
    }


    @Override
    public void bombed() {
    }

    @Override
    public void draw(Canvas canvas, Paint paint){
        Bitmap bitmap;
        if(round == 1) {
            bitmap = ImageManager.MISSILE_BITMAP;
            round = 2;
        } else {
            bitmap = ImageManager.MISSILE2_BITMAP;
            round = 1;
        }
        if(this.isValid) {
            canvas.drawBitmap(bitmap, (int)(this.getLocationX() - bitmap.getWidth() / 2.0), (int)(this.getLocationY() - bitmap.getHeight() / 2.0), paint);
        }
    }
}
